<?php
	//魔术方法
	/**
	 * 1、直接使用，不需要调用
	 */
	/**
	* 创建学生类
	*/
	class StudyClass
	{
		public $name;
		private $sex;
		private $height;
		private $width;

		public function __construct($name="", $sex=20, $height=180, $width=50) {
			$this->name = $name;
			$this->sex = $sex;
			$this->height = $height;
			$this->width = $width;
			echo "<br>";
		}

		public function __get($pro){
			echo "{$pro}*******************";
		}

		public function __destruct() {
			echo "GoodBy!!".$this->name."<br>";
		}
	}

	$a = new StudyClass("Tom", 20, 150, 100);
	echo $a->name = "Join";

	echo "马春晖";
 ?>
